Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.sw
Class Expression_Operation

    java.lang.Object
      rdlc.sw.Expression_Operation

All Implemented Interfaces:
  Expression

    public class Expression_Operation

extends java.lang.Object
implements Expression

Encodes an expression which requires actual computation in software. Many of the operations are software specific, of course.

Version:
  $Revision: 1.13 $
Author:
  Greg Gibeling

Field Summary
`protected java.util.List<Expression>` | `arguments` A list of the arguments to this operation.
`protected boolean` | `constant` Record whether this expressionr results in a constant based on it's arguments.
`static boolean[]` | `OP_ASSOC` A list of which operators are associative.
`static int` | `OP_BITAND` Bitwise and.
`static int` | `OP_BITNOT` Bitwise negation.
`static int` | `OP_BITOR` Bitwise or.
`static int` | `OP_BITXOR` Bitwise exclusive or.
`static int` | `OP_CALL` Function call.
`static int` | `OP_CAST` Type casting.
`static int` | `OP_DIV` Division.
`static int` | `OP_EQ` Equality test.
`static int` | `OP_GEQ` Greater than or equal to.
`static int` | `OP_GREATER` Strictly greater than.
`static java.lang.String[]` | `OP_INFIX` The infix operator for each operation.
`static int` | `OP_INVALID` The smallest positive invalid operation constant.
`static int` | `OP_INVOKE` Method invocation.
`static int` | `OP_LEQ` Less than or equal to.
`static int` | `OP_LESSER` Strictly less than.
`static int` | `OP_LOGICAND` Logical and.
`static int` | `OP_LOGICOR` Logical or.
`static int` | `OP_MINUS` Subtraction.
`static int` | `OP_MOD` Modulo (remainder).
`static int` | `OP_MUL` Multiplication.
`static java.lang.String[]` | `OP_NAME` A list of the name of the various operations for debugging.
`static int` | `OP_NEQ` Inequality test.
`static int` | `OP_NEW` New object construction.
`static int` | `OP_NOT` Logical not.
`static int` | `OP_PLUS` Addition.
`static int` | `OP_SHIFTLEFT` Shift logical left.
`static int` | `OP_SHIFTRIGHT` Shift logical right.
`static int` | `OP_TERNARY` Ternary operator (question mark followed by colon).
`protected int` | `operation` The actual operation code for this expression.

Constructor Summary
`Expression_Operation(Expression_Operation _source)` Copy constructor.
`Expression_Operation(int _operation)` Simple constructor.
`Expression_Operation(int _operation, Expression _arg0)` Simple constructor.
`Expression_Operation(int _operation, Expression _arg0, Expression _arg1)` Simple constructor.
`Expression_Operation(int _operation, Expression _arg0, Expression _arg1, Expression _arg2)` Simple constructor.

Method Summary
`void` | `addArgument(Expression _arg)` Add an argument to this expression.
`static Expression_Operation` | `bitAnd(Expression arg1, Expression arg2)` Create an expression representing a bitwise and.
`static Expression_Operation` | `bitAnd(Expression arg1, Expression arg2, Expression arg3)` Create an expression representing a bitwise and.
`static Expression_Operation` | `bitnot(Expression arg)` Create an expression representing a bitwise not.
`static Expression_Operation` | `bitOr(Expression arg1, Expression arg2)` Create an expression representing a bitwise or.
`static Expression_Operation` | `bitOr(Expression arg1, Expression arg2, Expression arg3)` Create an expression representing a bitwise or.
`static Expression_Operation` | `call(java.lang.String function)` Create an expression representing a function call.
`static Expression_Operation` | `call(java.lang.String function, Expression arg)` Create an expression representing a function call.
`static Expression_Operation` | `cast(Type arg1, Expression arg2)` Create an expression representing a type cast.
`static Expression_Operation` | `divide(Expression arg1, Expression arg2)` Create an expression representing a division.
`static Expression_Operation` | `equals(Expression arg1, Expression arg2)` Create an expression representing an equality test.
`static Expression_Operation` | `geq(Expression arg1, Expression arg2)` Create an expression representing a greater or equality test.
`Expression` | `getArgument(int index)` Simple accessor.
`int` | `getNArguments()` Simple accessor.
`int` | `getOperation()` Simple accessor.
`static Expression_Operation` | `greater(Expression arg1, Expression arg2)` Create an expression representing a greater test.
`static Expression_Operation` | `invoke(Expression object, java.lang.String method)` Create an expression representing an object method invocation.
`static Expression_Operation` | `invoke(Expression object, java.lang.String method, Expression arg)` Create an expression representing an object method invocation.
`boolean` | `isConstant()` Simple accessor.
`boolean` | `isLValue()` Simple accessor.
`boolean` | `isRValue()` Simple accessor.
`static Expression_Operation` | `leq(Expression arg1, Expression arg2)` Create an expression representing a lesser or equality test.
`static Expression_Operation` | `lesser(Expression arg1, Expression arg2)` Create an expression representing a lesser test.
`protected java.lang.String` | `listString(int start)` Simple accessor.
`static Expression_Operation` | `logicAnd(Expression arg1, Expression arg2)` Create an expression representing a logical and.
`static Expression_Operation` | `logicOr(Expression arg1, Expression arg2)` Create an expression representing a logical or.
`static Expression_Operation` | `minus(Expression arg1, Expression arg2)` Create an expression representing a subtraction.
`static Expression_Operation` | `modulo(Expression arg1, Expression arg2)` Create an expression representing a modulo (remainder).
`static Expression_Operation` | `multiply(Expression arg1, Expression arg2)` Create an expression representing a multiplication.
`static Expression_Operation` | `nequals(Expression arg1, Expression arg2)` Create an expression representing an inequality test.
`static Expression_Operation` | `newType(Type type)` Create an expression representing an object allocation and initialization.
`static Expression_Operation` | `newType(Type type, Expression arg1)` Create an expression representing an object allocation and initialization.
`static Expression_Operation` | `not(Expression arg)` Create an expression representing a logical not.
`static Expression_Operation` | `plus(Expression arg1, Expression arg2)` Create an expression representing an addition.
`static Expression_Operation` | `shiftLeft(Expression value, Expression shAmt)` Create an expression representing a logical shift left.
`static Expression_Operation` | `shiftRight(Expression value, Expression shAmt)` Create an expression representing a logical shift right.
`static Expression_Operation` | `ternary(Expression input, Expression outTrue, Expression outFalse)` Create an expression representing an ternary operation.
`java.lang.String` | `toString()` Simple accessor.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### OP_BITNOT

    public static final int OP_BITNOT

  Bitwise negation.

  See Also:
    Constant Field Values

### OP_SHIFTRIGHT

    public static final int OP_SHIFTRIGHT

  Shift logical right.

  See Also:
    Constant Field Values

### OP_SHIFTLEFT

    public static final int OP_SHIFTLEFT

  Shift logical left.

  See Also:
    Constant Field Values

### OP_BITAND

    public static final int OP_BITAND

  Bitwise and.

  See Also:
    Constant Field Values

### OP_BITOR

    public static final int OP_BITOR

  Bitwise or.

  See Also:
    Constant Field Values

### OP_BITXOR

    public static final int OP_BITXOR

  Bitwise exclusive or.

  See Also:
    Constant Field Values

### OP_PLUS

    public static final int OP_PLUS

  Addition.

  See Also:
    Constant Field Values

### OP_MINUS

    public static final int OP_MINUS

  Subtraction.

  See Also:
    Constant Field Values

### OP_MUL

    public static final int OP_MUL

  Multiplication.

  See Also:
    Constant Field Values

### OP_DIV

    public static final int OP_DIV

  Division.

  See Also:
    Constant Field Values

### OP_MOD

    public static final int OP_MOD

  Modulo (remainder).

  See Also:
    Constant Field Values

### OP_EQ

    public static final int OP_EQ

  Equality test. Note that this may be special cased to handle string equality.

  See Also:
    Constant Field Values

### OP_NEQ

    public static final int OP_NEQ

  Inequality test. Note that this may be special cased to handle strin inequality.

  See Also:
    Constant Field Values

### OP_GEQ

    public static final int OP_GEQ

  Greater than or equal to.

  See Also:
    Constant Field Values

### OP_GREATER

    public static final int OP_GREATER

  Strictly greater than.

  See Also:
    Constant Field Values

### OP_LEQ

    public static final int OP_LEQ

  Less than or equal to.

  See Also:
    Constant Field Values

### OP_LESSER

    public static final int OP_LESSER

  Strictly less than.

  See Also:
    Constant Field Values

### OP_INVOKE

    public static final int OP_INVOKE

  Method invocation.

  See Also:
    Constant Field Values

### OP_NEW

    public static final int OP_NEW

  New object construction.

  See Also:
    Constant Field Values

### OP_CAST

    public static final int OP_CAST

  Type casting.

  See Also:
    Constant Field Values

### OP_CALL

    public static final int OP_CALL

  Function call.

  See Also:
    Constant Field Values

### OP_NOT

    public static final int OP_NOT

  Logical not.

  See Also:
    Constant Field Values

### OP_TERNARY

    public static final int OP_TERNARY

  Ternary operator (question mark followed by colon).

  See Also:
    Constant Field Values

### OP_LOGICAND

    public static final int OP_LOGICAND

  Logical and.

  See Also:
    Constant Field Values

### OP_LOGICOR

    public static final int OP_LOGICOR

  Logical or.

  See Also:
    Constant Field Values

### OP_INVALID

    public static final int OP_INVALID

  The smallest positive invalid operation constant.

  See Also:
    Constant Field Values

### OP_NAME

    public static final java.lang.String[] OP_NAME

  A list of the name of the various operations for debugging.

### OP_INFIX

    public static final java.lang.String[] OP_INFIX

  The infix operator for each operation. Note a blank string here represents a non-infix operator.

### OP_ASSOC

    public static final boolean[] OP_ASSOC

  A list of which operators are associative. Two identical associative operations, one of which contains the other will be automatically merged.

### constant

    protected boolean constant

  Record whether this expressionr results in a constant based on it's arguments.

### operation

    protected int operation

  The actual operation code for this expression.

### arguments

    protected java.util.List<Expression> arguments

  A list of the arguments to this operation.

Constructor Detail

### Expression_Operation

    public Expression_Operation(int _operation)

  Simple constructor. Stores and validates the operation. Assumes arguments will be added later.

  Parameters:
    `_operation` - The operation.
  See Also:
    `addArgument(Expression)`

### Expression_Operation

    public Expression_Operation(int _operation,
                                Expression _arg0)

  Simple constructor. Stores and validates the operation and one argument. More arguments may be added later.

  Parameters:
    `_operation` - The operation.
    `_arg0` - The first argument.

### Expression_Operation

    public Expression_Operation(int _operation,
                                Expression _arg0,
                                Expression _arg1)

  Simple constructor. Stores and validates the operation and two arguments. More arguments may be added later.

  Parameters:
    `_operation` - The operation.
    `_arg0` - The first argument.
    `_arg1` - The second argument.

### Expression_Operation

    public Expression_Operation(int _operation,
                                Expression _arg0,
                                Expression _arg1,
                                Expression _arg2)

  Simple constructor. Stores and validates the operation and three arguments. More arguments may be added later.

  Parameters:
    `_operation` - The operation.
    `_arg0` - The first argument.
    `_arg1` - The second argument.
    `_arg2` - The third argument.

### Expression_Operation

    public Expression_Operation(Expression_Operation _source)

  Copy constructor.

  Parameters:
    `_source` - The expression to copy.

Method Detail

### isConstant

    public boolean isConstant()

  Description copied from interface: `Expression`
  Simple accessor.

  Specified by:
    `isConstant` in interface `Expression`
  Returns:
    `true` if this expression is a constant.
  See Also:
    `Expression.isConstant()`

### isLValue

    public boolean isLValue()

  Description copied from interface: `Expression`
  Simple accessor.

  Specified by:
    `isLValue` in interface `Expression`
  Returns:
    `true` if this expression can be used as an l-value.
  See Also:
    `Expression.isLValue()`

### isRValue

    public boolean isRValue()

  Description copied from interface: `Expression`
  Simple accessor.

  Specified by:
    `isRValue` in interface `Expression`
  Returns:
    `true` if this expression can be used as an e-value.
  See Also:
    `Expression.isRValue()`

### addArgument

    public void addArgument(Expression _arg)

  Add an argument to this expression. Not only will this check and update the constant flag for this expression, but if the new argument is an identical operation and the operation is associative it will merge the two expressions.

  Parameters:
    `_arg` - The argument to add to this expression.

### getOperation

    public int getOperation()

  Simple accessor.

  Returns:
    The operation performed by this expression.

### getNArguments

    public int getNArguments()

  Simple accessor.

  Returns:
    The number of arguments to this expression.

### getArgument

    public Expression getArgument(int index)

  Simple accessor.

  Parameters:
    `index` - The index of the argument to return.
  Returns:
    The argument expression at the given index.

### toString

    public java.lang.String toString()

  Simple accessor.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    A human readable representation of this expression for debugging.

### listString

    protected java.lang.String listString(int start)

  Simple accessor.

  Parameters:
    `start` - The index of the first argument to list.
  Returns:
    A string representing a listing of all the arguments to this expression.

### bitnot

    public static Expression_Operation bitnot(Expression arg)

  Create an expression representing a bitwise not.

  Parameters:
    `arg` - The expression to invert.
  Returns:
    An expression representing a bitwise not.

### not

    public static Expression_Operation not(Expression arg)

  Create an expression representing a logical not.

  Parameters:
    `arg` - The expression to invert.
  Returns:
    An expression representing a logical not.

### shiftRight

    public static Expression_Operation shiftRight(Expression value,
                                                  Expression shAmt)

  Create an expression representing a logical shift right.

  Parameters:
    `value` - The value to shift.
    `shAmt` - The amount to shift it by.
  Returns:
    An expression representing a logical shift right.

### shiftLeft

    public static Expression_Operation shiftLeft(Expression value,
                                                 Expression shAmt)

  Create an expression representing a logical shift left.

  Parameters:
    `value` - The value to shift.
    `shAmt` - The amount to shift it by. If this is not a constant the shift will be EXPENSIVE in hardware.
  Returns:
    An expression representing a logical shift left.

### bitAnd

    public static Expression_Operation bitAnd(Expression arg1,
                                              Expression arg2)

  Create an expression representing a bitwise and.

  Parameters:
    `arg1` - The first argument to and.
    `arg2` - The second argument to and.
  Returns:
    An expression representing a bitwise and.

### bitAnd

    public static Expression_Operation bitAnd(Expression arg1,
                                              Expression arg2,
                                              Expression arg3)

  Create an expression representing a bitwise and.

  Parameters:
    `arg1` - The first argument to and.
    `arg2` - The second argument to and.
    `arg3` - The third argument to and.
  Returns:
    An expression representing a bitwise and.

### bitOr

    public static Expression_Operation bitOr(Expression arg1,
                                             Expression arg2)

  Create an expression representing a bitwise or.

  Parameters:
    `arg1` - The first argument to or.
    `arg2` - The second argument to or.
  Returns:
    An expression representing a bitwise or.

### bitOr

    public static Expression_Operation bitOr(Expression arg1,
                                             Expression arg2,
                                             Expression arg3)

  Create an expression representing a bitwise or.

  Parameters:
    `arg1` - The first argument to or.
    `arg2` - The second argument to or.
    `arg3` - The third argument to or.
  Returns:
    An expression representing a bitwise or.

### plus

    public static Expression_Operation plus(Expression arg1,
                                            Expression arg2)

  Create an expression representing an addition.

  Parameters:
    `arg1` - The first argument to add.
    `arg2` - The second argument to add.
  Returns:
    An expression representing an addition.

### minus

    public static Expression_Operation minus(Expression arg1,
                                             Expression arg2)

  Create an expression representing a subtraction.

  Parameters:
    `arg1` - The first argument to subtract.
    `arg2` - The second argument to subtract.
  Returns:
    An expression representing a subtraction.

### multiply

    public static Expression_Operation multiply(Expression arg1,
                                                Expression arg2)

  Create an expression representing a multiplication.

  Parameters:
    `arg1` - The multiplicand.
    `arg2` - The multiplier.
  Returns:
    An expression representing a multiplication.

### divide

    public static Expression_Operation divide(Expression arg1,
                                              Expression arg2)

  Create an expression representing a division.

  Parameters:
    `arg1` - The dividend.
    `arg2` - The divisor.
  Returns:
    An expression representing a divisor.

### modulo

    public static Expression_Operation modulo(Expression arg1,
                                              Expression arg2)

  Create an expression representing a modulo (remainder).

  Parameters:
    `arg1` - The dividend.
    `arg2` - The divisor.
  Returns:
    An expression representing a modulo.

### newType

    public static Expression_Operation newType(Type type)

  Create an expression representing an object allocation and initialization.

  Parameters:
    `type` - The type of the object being created.
  Returns:
    An expression representing an object allocation and initialization.

### newType

    public static Expression_Operation newType(Type type,
                                               Expression arg1)

  Create an expression representing an object allocation and initialization.

  Parameters:
    `type` - The type of the object being created.
    `arg1` - An argument to give to the constructor.
  Returns:
    An expression representing an object allocation and initialization.

### invoke

    public static Expression_Operation invoke(Expression object,
                                              java.lang.String method)

  Create an expression representing an object method invocation.

  Parameters:
    `object` - The object on which the method is being invoked.
    `method` - The name of the method to invoke.
  Returns:
    An expression representing an object method invocation.

### invoke

    public static Expression_Operation invoke(Expression object,
                                              java.lang.String method,
                                              Expression arg)

  Create an expression representing an object method invocation.

  Parameters:
    `object` - The object on which the method is being invoked.
    `method` - The name of the method to invoke.
    `arg` - An argument to the method.
  Returns:
    An expression representing an object method invocation.

### call

    public static Expression_Operation call(java.lang.String function)

  Create an expression representing a function call.

  Parameters:
    `function` - The name of the function to invoke.
  Returns:
    An expression representing a function call.

### call

    public static Expression_Operation call(java.lang.String function,
                                            Expression arg)

  Create an expression representing a function call.

  Parameters:
    `function` - The name of the function to invoke.
    `arg` - An argument to the function call.
  Returns:
    An expression representing a function call.

### equals

    public static Expression_Operation equals(Expression arg1,
                                              Expression arg2)

  Create an expression representing an equality test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing an equality test.

### nequals

    public static Expression_Operation nequals(Expression arg1,
                                               Expression arg2)

  Create an expression representing an inequality test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing an inequality test.

### geq

    public static Expression_Operation geq(Expression arg1,
                                           Expression arg2)

  Create an expression representing a greater or equality test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing a greater or equality test.

### greater

    public static Expression_Operation greater(Expression arg1,
                                               Expression arg2)

  Create an expression representing a greater test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing a greater test.

### leq

    public static Expression_Operation leq(Expression arg1,
                                           Expression arg2)

  Create an expression representing a lesser or equality test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing a lesser or equality test.

### lesser

    public static Expression_Operation lesser(Expression arg1,
                                              Expression arg2)

  Create an expression representing a lesser test.

  Parameters:
    `arg1` - An the first argument to compare.
    `arg2` - An the second argument to compare.
  Returns:
    An expression representing a lesser test.

### cast

    public static Expression_Operation cast(Type arg1,
                                            Expression arg2)

  Create an expression representing a type cast.

  Parameters:
    `arg1` - The type to cast the second argument to.
    `arg2` - An the argument to cast.
  Returns:
    An expression representing a type cast.

### ternary

    public static Expression_Operation ternary(Expression input,
                                               Expression outTrue,
                                               Expression outFalse)

  Create an expression representing an ternary operation.

  Parameters:
    `input` - The test expression.
    `outTrue` - The true clause.
    `outFalse` - The false clause.
  Returns:
    An expression representing a ternary operation.

### logicAnd

    public static Expression_Operation logicAnd(Expression arg1,
                                                Expression arg2)

  Create an expression representing a logical and.

  Parameters:
    `arg1` - The first argument to and.
    `arg2` - The second argument to and.
  Returns:
    An expression representing a logical and.

### logicOr

    public static Expression_Operation logicOr(Expression arg1,
                                               Expression arg2)

  Create an expression representing a logical or.

  Parameters:
    `arg1` - The first argument to and.
    `arg2` - The second argument to and.
  Returns:
    An expression representing a logical or.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD